<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var a =1
        console.log(a);
        pl()
        console.log(window.a);
        window.pl()
        function pl () {
            console.log(2);
        }

        window.addEventListener('load',function () {
                console.log("页面加载完成了")
        })

        window.addEventListener('resize',function () {
                console.log("页面大小变了")
                console.log(window.innerWidth)
                console.log(window.innerHeight)
        })
    </script>
</body>
</html>